40923247 cp2020

  • Home
    • Site Map
    • reveal
    • blog
  • 首頁
  • HW1
    • U13
      • IPv4 and IPv6 Addresses
      • IPv4 Addressing
      • IPv4 Address Classes
      • Assigning an IP Address 分配IP地址
      • IPv6
      • Classful Vs  Classless Addressing  Subnet and CIDR
      • Windows Networking Windows網絡
    • U14
      • Overview 概述
      • TCP and UDP
      • TCP IP Stack
      • Networking Transfer Protocols 網絡傳輸協議
      • FTP
      • SSL
  • HW2
    • 2-1
    • 2-2
    • 2-3
  • HW3
    • Exercise 34 練習34
    • Exercise 24  練習24
    • Exercise 28  練習28
IPv4 Addressing << Previous Next >> Assigning an IP Address 分配IP地址

IPv4 Address Classes

IPv4地址類別

As you can see, when the subnet mask has a 255 in it, it is defining the network portion of the address. In class A addresses, the first octet defines the network, and the last three define the host. In class B addresses, the first two octets define the network, the last two define the host. In class C addresses, the first three octets define the network, the last one defines the host.

如您所見,當子網掩碼中包含255時,它定義了地址的網絡部分。 在A類地址中,第一個八位位組定義網絡,最後三個八位位組定義主機。 在B類地址中,前兩個八位位組定義網絡,後兩個定義主機。 在C類地址中,前三個八位位組定義網絡,最後一個八位位組定義主機。

Subnet class table. Image used under CC-BY license from Jason Dion.

 

Subnet masks are used to define the specific network we are referencing. A standard class A subnet mask of 255.0.0.0 is used for all networks where the first octet starts with a number between 1 and 126. Recall from the subnet table below, our network was 10.0.0.0.

子網掩碼用於定義我們要引用的特定網絡。 255.0.0.0的標準A類子網掩碼適用於所有第一個八位位組以1到126之間的數字開頭的網絡。從下面的子網表中調用,我們的網絡為10.0.0.0。

IP address (in decimal)

10

1

2

3

IP address (in binary)

00001010

00000001

00000010

00000011

Subnet mask (in decimal)

255

0

0

0

Subnet mask (in binary)

11111111

00000000

00000000

00000000

Network bits

Host bits

Host bits

Host bits

Therefore, this address fits into the class A category. In this course, we only deal with “classful” subnet masks — the ones that only contain values of 255 and 0. In future courses, you may see other subnet masks used to further break apart the networks.

因此,該地址屬於A類類別。 在本課程中,我們僅處理“有類”子網掩碼-僅包含255和0的值。在以後的課程中,您可能會看到用於進一步拆分網絡的其他子網掩碼。

Address Class

Value in First Octet

Classful Mask (Dotted Decimal)

Classful Mask (Prefix Notation)

Class A

1 – 126

255.0.0.0

/8

Class B

128 – 191

255.255.0.0

/16

Class C

192 – 223

255.255.255.0

/24

As you can see in the address classes table, class A references networks with the first octet having a value of 1-126, class B references 128-191, class C references 192-223. There is also a special address called the loopback address, which is 127.0.0.1. The entire range of 127.x.x.x is reserved to support this loopback address. A loopback address is an IP reserved to reference the computer on which you are currently working. Every computer knows to answer up for itself when a reference to 127.0.0.1 is given. This is also known as as the “localhost.”

 

To route your traffic over the Internet, you are required to have a publically routable IP address. These addresses are globally managed by the Internet Corporation for Assigned Names and Numbers (ICANN). If you desire to have one of these addresses, you must purchase them for use to ensure no one else has that specific number. For most users, this is done for you by your Internet service provider (ISP), but if you have a need for numerous public IP addresses, you can buy a block of them from ICANN.

 

Private IP addresses, on the other hand, can be used by anyone without any prior coordination. This is because private IP addresses are not routable over the Internet and are only used inside your local area network. For example, at your home, you may have five computers hooked up to your switch and those machines are all using private IP addresses. When you make a request to go outside the network, like to visit a college’s website, your router performs a network address translation (NAT) that allows your private IP address to be converted into a public IP address and a port, which then makes the request on your behalf. There is a specific range of IP addresses that are reserved as private for internal use (by you and others).

如您在地址類別表中看到的,類別A引用第一個八位位組的值是1-126的網絡,類別B引用128-191,類別C引用192-223。還有一個稱為回送地址的特殊地址,即127.0.0.1。保留127.x.x.x的整個範圍以支持此回送地址。回送地址是保留的IP,用於引用您當前正在使用的計算機。當給出對127.0.0.1的引用時,每台計算機都知道會自己回答。這也稱為“本地主機”。

要通過Internet路由流量,您需要具有可公共路由的IP地址。這些地址由互聯網名稱與數字地址分配機構(ICANN)全局管理。如果您希望擁有這些地址之一,則必須購買它們以確保沒有其他人擁有該特定號碼。對於大多數用戶而言,這是由Internet服務提供商(ISP)為您完成的,但是如果您需要大量的公共IP地址,則可以從ICANN購買其中的一部分。

 

另一方面,任何人都可以使用私有IP地址,而無需事先協調。這是因為專用IP地址無法通過Internet路由,而只能在局域網內使用。例如,在家裡,您可能有五台計算機連接到交換機,而這些計算機都使用私有IP地址。當您發出訪問網絡的請求(例如訪問大學的網站)時,路由器會執行網絡地址轉換(NAT),該轉換可將您的私有IP地址轉換為公共IP地址和端口,從而使代表您提出要求。有一個特定範圍的IP地址保留為私有(供您和他人使用)供內部使用。


IPv4 Addressing << Previous Next >> Assigning an IP Address 分配IP地址

Copyright © All rights reserved | This template is made with by Colorlib